<!-- 页面预览 -->
<template>
    <a-modal v-model:open="data.open" width="100%" centered :maskClosable="false" title="页面预览" @cancel="handleCancel"
        wrap-class-name="custom-modal-wrap full" :destroyOnClose="true" :footer="null">
        <dcPageBuilder :pageTemplate="generateData" @ready="onReady"></dcPageBuilder>
    </a-modal>
</template>

<script setup>
import { reactive, defineExpose } from 'vue'
import dcPageBuilder from '../../builder/dcPageBuilder.vue';
import { generateData, pageData } from '../../pageManager.js'

defineProps({
})

const data = reactive({
    open: false,
    formId: '',
    builderManager: null,
})

const open = () => {
    data.open = true
}

// 暴露函数
defineExpose({
    open
})

const handleCancel = () => {
    data.open = false
}

const onReady = (builder) => {
    data.builderManager = builder
}

</script>

<style lang="less" scoped>
.dc-page-builder {
    border: 1px solid var(--borderColor);
    margin: 0 auto;
    height: 100%;
    overflow: auto;
}
</style>